def count(str):
    number=0
    letter=0
    black=0
    other=0
    for c in str:
        if c.isdigit():
            number+=1
        elif c=='':
            black+=1
        elif c.isalpha():
            letter+=1
        else:
            other+=1
    print(f"数字有{number}个，字母有{letter}个，空格有{black}个，其他有{other}个")
count('12abAB[$')
